#ifndef GAMECOIN_H
#define GAMECOIN_H

#include <QPushButton>
#include <QTimer>

class GameCoin : public QPushButton
{
    Q_OBJECT
public:
    explicit GameCoin(QString img ,QWidget *parent = nullptr);
    void changeFlag();

    int posX() const;
    void setX(int newposX);

    int posY() const;
    void setY(int newposY);


    bool flag() const;
    void setFlag(bool newFlag);

    bool isWin() const;
    void setwin(bool newWin);

    void mousePressEvent(QMouseEvent *e);

signals:
private:
    int m_posx;
    int m_posy;
    bool m_flag;//确认点击
    bool m_isAnimation;//防止连续点击
    bool m_iswin;


    int m_minIndex;
    int m_maxIndex;
    QTimer *m_timerToFront;
    QTimer *m_timerToBack;

};

#endif // GAMECOIN_H
